package 历年真题;

public class q22 {

	public static void calculate(int primaryNumX,int primaryNumY,int timesOfMinute){
		int numX = primaryNumX,numY = primaryNumY;
		for(int i=2;i<=timesOfMinute*2;i++){
			
			//已经灭绝了
			if(numY<=0){
				numY=0;
				break;
			}
			
			if(i%2==0){
				numY-=primaryNumX;
			}else if(i%2==1){
				numY-=(numX-primaryNumX);
			}
			
			if(i%6==0){
				numX*=2;
			}
			
			if(i%4==0){
				numY*=2;
			}
		}
		System.out.println(numY);
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		calculate(10,89,60);
	}

}
